import request from '@/utils/request'
import qs from 'qs'
const api = {
departmentlist  : 'admin/tdepartment/list'

}

export default api

export function getDepartmentList (parameter) {
  return request({
    url: api.departmentlist,
    method: 'post',
    params: parameter
  })
}

export function saveDepartment (department) {
  return request({
    url:  department.departmentId === 0 ? '/admin/tdepartment/save' : '/admin/tdepartment/update' ,
    method: department.departmentId === 0 ? 'post' : 'put',
    data: department
  })
}


export function deleteDepartment (params) {
  return request({
    url:  '/admin/tdepartment/delete' ,
    method: 'post' ,
    data:  params
  })
}

